package com.txr.news.mapper;

import com.txr.news.pojo.entity.Article;
import com.txr.news.pojo.entity.ArticleExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ArticleMapper {
    int countByExample(ArticleExample example);

    int deleteByExample(ArticleExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Article record);

    int insertSelective(Article record);

    List<Article> selectByExampleWithBLOBs(ArticleExample example);

    List<Article> selectByExample(ArticleExample example);

    Article selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Article record, @Param("example") ArticleExample example);

    int updateByExampleWithBLOBs(@Param("record") Article record, @Param("example") ArticleExample example);

    int updateByExample(@Param("record") Article record, @Param("example") ArticleExample example);

    int updateByPrimaryKeySelective(Article record);

    int updateByPrimaryKeyWithBLOBs(Article record);

    int updateByPrimaryKey(Article record);

    /**
     * 分步查询
     */
    List<Article> getArticleAndCateByStepOne(@Param("is_delete") Boolean isDelete);


    List<Article> getArticleAndCate(@Param("is_delete") Boolean isDelete,
                                    @Param("cate_id") Integer cate_id,
                                    @Param("state")String state);
}